package cn.bonoon.kernel.web.components;

import cn.bonoon.kernel.descriptors.UIPropertyAccessor;
import cn.bonoon.kernel.web.annotations.components.AsPassword;
import cn.bonoon.kernel.web.html.UIPropertyBuilder;
import cn.bonoon.kernel.web.html.form.ComponentPropertyParser;

public class PasswordComponent extends AbstractComponent {

	public PasswordComponent(ComponentPropertyParser property, UIPropertyAccessor accessor, AsPassword asPassword) { 
		super(property, accessor);
	}

	@Override
	protected void parser(UIPropertyBuilder builder) {
		int width = componentWidth();
		StringBuilder html = builder.getInitHtml();
		html.append("<input type='password'");
		__component(html);
		html.append("style='width:").append(width).append("px;'/>");
	}
}
